package com.zl.easybuy.util;

import com.zl.easybuy.pojo.Product;
import lombok.Data;

@Data
public class ShoppingCartItem {
    private Product product;
    private Integer quantity;
//    private Double cost;
    public double getCost(){
        if(product == null || quantity == null){
            return 0;
        }
        return product.getPrice() * quantity;
    }
}
